/*	
 *				
 *					ISNW ---- It is a war.It is not warcraft!
 *
 *
 *					Author:					zhoukeli(haxixi_keli)
 *					Filename:				MeshCache.h
 *					CreateTime:				2008/12/21
 *					ModifyTime:				2008/12/21
 *
 */

#ifndef __ISNW_MESH_CACHE_H__
#define __ISNW_MESH_CACHE_H__

#include "include/IMeshCache.h"
#include "include/isnwArray.h"
#include "include/isnwString.h"

namespace ISNW
{
namespace scene
{
	class MeshCache : public IMeshCache
	{
	public:
		struct MeshEntry
		{
			core::string	filename;
			IAnimateMesh*			mesh;

		public:
			MeshEntry():mesh(0){}
		};

	public:
		//! get mesh
		virtual IAnimateMesh*	getmesh(const c8* filename);
		virtual const IAnimateMesh* getmesh(const c8* filename) const;

		//! add mesh
		virtual void addmesh(const c8* filename,IAnimateMesh* mesh);

		//! remove mesh
		virtual bool removemesh(const c8* filename);

		virtual bool removemesh(const IAnimateMesh* mesh);

		virtual bool removemesh(const u32 idx);

	protected:
		core::array<MeshEntry>	meshes;
	};
} // end namespace scene
} // end namespace ISNW
#endif